package com.netmarch.api.controller;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.netmarch.entity.User;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

@Api(value = "测试新模块")
@RestController
@RequestMapping("/accp")
public class AccpController {
	/**
     * 新建用户
     *
     * @param user
     * @return
     */
    @ApiOperation(value = "新建用户", notes = "新建一个用户")
//    @ApiImplicitParams({
              //注意：paramType需要指定为body
//            @ApiImplicitParam(name = "user", value = "用户数据", required = true, paramType = "body", dataType = "User") 
//    })
    @RequestMapping(value = "", method = RequestMethod.POST)
    public String create(@ApiParam(value = "用户数据", required = true) @RequestBody User user) {
        System.out.println("user : " + user.getName() + " " + user.getEmail());
        return "success 新建user : " + user.getName() + " " + user.getEmail();
    }
}
